<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <title>倒计时</title>
    <meta name="Anthor" content="月影-253737688" />
    <meta name="viewport" content="width=device-width,minimum-scale=1.0,maximum-scale=1.0,user-scalable=no"/>
    <meta name="format-detection" content="telephone=no"/>
    <style>
        .conpy{
            width: 100%;
            display: flex;
            justify-content: space-between;
            align-items: center;
        }
    </style>
</head>
<body>
<div class="vueBox">
    <div class="conpy">
        <p>微信号：{{message}}</p>
        <span class="copy"   @click="doCopy()"> 复制微信号 </span>
    </div>
</div>
<script src="js/vue.min.2.5.13.js"></script>
<script src="js/clipboard.min.js"></script>
<script>
    var vm = new Vue({
        el: ".vueBox",
        data: {
            message: 'King'
        },
        created:function() {

        },
        methods: {
            doCopy: function (val) {
                var clipboard = new ClipboardJS('.copy', {
                    text: ()=> {
                        return this.message;
                    }
                });
                clipboard.on('success', function(e) {
                    console.log(e);
                });

                clipboard.on('error', function(e) {
                    console.log(e);
                });
            }

        }

    });
</script>
</body>
</html>
